<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        button{
            
            width: 50px;
            height: 50px;
        }
        .hong{
            background-color: red;
            width: 50px;
            height: 50px;
        }
        .huang{
            background-color: yellow;
            width: 50px;
            height: 50px;
        }
        .lan{
            background-color: blue;
            width: 50px;
            height: 50px;
        }
        .small{
            border: 5px solid black;
            border-color: black;
            background-color: orange;
            width: 200px;
            height: 200px;
        }
        .big{
            width: 100%;
            height: 100%;
            background-color: aquamarine;
        }
        .cd{
            float: right;
            opacity: 0;
            width: 300px;
            height: 300px;
            background-color: rgb(227, 218, 218);
        }
        
    </style>
</head>
<body>
    <div class="big">
        <p>请为下面的DIV设置样式: <button type="submit">点击设置</button></p>
        <div class="cd">
            <p>请选择背景色: <button class="hong" type="submit">红<button type="submit" class="huang">黄<button type="submit" class="lan">蓝</button></p>
            <p>请选择宽(px): <button class="k2" type="submit">200<button type="submit" class="k3">300<button type="submit" class="k4">400</button></p>
            <p>请选择高(px): <button class="g2" type="submit">200<button type="submit" class="g3">300<button type="submit" class="g4">400</button></p>
        </div>
    <div class="small"></div>
    </div>
</body>
</html>
<script>
    var but=document.querySelector('button')
    var cd=document.querySelector(".cd")
    but.onclick=function(){
     cd.style.opacity=1;
    }
    
</script>